package com.yeeft.ocr.mapper;

import com.yeeft.ocr.domain.entity.OcrLog;
import com.yeeft.ocr.domain.entity.UserTest;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 功能简要描述
 *
 * @author 赵仲文
 * @Copyright (c) 2016, frontpay.cn
 * @date 2018/5/7 15:59
 */

@Mapper
public interface OcrLogMapper {
    @Select("SELECT * FROM OcrLog WHERE supplierId = #{supplierId} and logId = #{logId}")
    OcrLog findOcrResult(@Param("supplierId") String supplierId, @Param("logId") String logId);

    @Insert("INSERT INTO OcrLog(ocrId, appId, supplierId, bizId, logId, imageUrl, result) " +
            "VALUES(#{ocrId}, #{appId}, #{supplierId}, #{bizId}, #{logId}, #{imageUrl}, #{result})")
    int insert(@Param("ocrId") String ocrId, @Param("appId") String appId,
                  @Param("supplierId") Integer supplierId, @Param("bizId") Integer bizId,
                  @Param("logId") String logId, @Param("imageUrl") String imageUrl, @Param("result") String result);

    @Select("select * from OcrLog")
    List<OcrLog> selectLogs();
}
